package com.lagou.lagouserviceemail.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Authther: mrwu
 * @date:2021/4/15-04
 * @Description:com.lagou.lagouserviceemail.controller
 */
@RefreshScope//设置刷新
@RestController
public class TestConfigController {
//    @Value("${name}")//从环境变量中取出变量值
    private String name;

    public void setName(String name) {
        this.name = name;
    }

    @GetMapping("/hello")
    public String testname(){
        return name;
    }

}
